// 菜单管理接口
import request from "@/utils/request";
export function getDishPage(params) {
  return request({
    url: "/dish/page",
    method: "get",
    params,
  });
}

// 获取菜品分类列表
export function getCategoryList(params) {
  return request({
    url: "/category/list",
    method: "get",
    params,
  });
}

// 上传图片
export function uploadImages(formData) {
  return request({
    headers: {
      "Content-Type": "multipart/form-data",
    },
    url: "/common/upload",
    method: "post",
    data: formData,
  });
}

// 新增菜品
export function addDish(params) {
  return request({
    url: "/dish",
    method: "post",
    data: { ...params },
  });
}

// 修改菜品
export function editDish(params) {
  return request({
    url: "/dish",
    method: "put",
    data: { ...params },
  });
}

// 修改启售/停售状态
export function dishStatusByStatus(params, status) {
  return request({
    url: `/dish/status/${status}`,
    method: "post",
    params,
  });
}
